home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_bab_generatorpull.cog < prev    next >
Text File  |  1999-11-15  |  9KB  |  276 lines

  1. # Jones 3D Cog Script
  2. #
  3. # BAB_GeneratorPull.cog
  4. #
  5. # [SXC & revised by HB]
  6. #
  7. # Indy starts generator.
  8. #
  9. #
  10. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  11. #
  12. # ========================================================================================
  13.  
  14. symbols
  15.  
  16.     message        startup
  17.     message        activated
  18.     message        user4 # news from alarmcog
  19.     
  20.     model       litlamp=bab_lamp_hang.3do               local
  21.     keyframe    in_pull=in_push_lever.key                local
  22.     keyframe    lever_down=bab_ngin_lite_lever.key        local
  23.     keyframe    engine_rotate=bab_ngin_lite.key         local
  24.     
  25.     material    animat=elvatr_rock_chain.mat            local
  26.     
  27.     sound       zapsound
  28.     sound       powerHum=pyr_gas_motor.wav              local
  29.     sound       gatesqueal=fol_in_scrapemetal_med.wav   local
  30.     sound       leverpull=nub_lever_pull_c.wav  local   local
  31.     sound       leverback=nub_lever_reset_c.wav local   local
  32.     sound       gatestop=tem_ldoorr_ldoorl_close_c.wav  local
  33.     sound       gatesqueal=fol_in_scrapemetal_med.wav   local
  34.     sound       dangerwav=mus_gen_danger3.wav           local
  35.  
  36.     cog            alarmcog
  37.     
  38.     template    spark0
  39.     template    spark1
  40.    
  41.     thing        player                                    local
  42.  
  43.     thing        indy                                    nolink
  44.     thing        powerCam                                nolink
  45.     thing       badguyCam                                nolink
  46.     thing       sparkpos0
  47.     thing       sparkpos1
  48.     thing       generator                               linkid=1
  49.     thing       fenceDoor
  50.     thing       fencedoor1
  51.     thing       fencedoor2
  52.     thing       enemy0
  53.     thing       enemy1
  54.     thing       tgt0
  55.     thing       tgt1
  56.     thing        badguytarget                            nolink
  57.     
  58.     thing       lamp0
  59.     thing       lamp1
  60.     thing       lamp2
  61.     thing       lamp3
  62.     thing       lamp4
  63.     thing       lamp5
  64.     thing       lamp6
  65.     thing       lamp7
  66.  
  67.     int            count                                    local
  68.     vector      litVec                                  local
  69.     int         check=0                                 local
  70.     int         gatechannel                             local
  71.     int         gatechannel1                            local
  72.     int         wepnum=1        local
  73.     int         lastrand=-1     local
  74.     int         currand=0       local
  75.     
  76.     sound       indylineb0=inxj058.wav      local
  77.     sound       indylineb1=inxj059.wav      local
  78.     sound       indylineb2=inxj060.wav      local
  79.     sound       indylineb3=inxj061.wav      local
  80.     sound       indylineb4=inxj090.wav      local
  81.     sound       indylineb5=inxj095.wav      local
  82.     
  83.     cog         BAB_Commie_grid         #Added by JM
  84.  
  85. end
  86.  
  87. # ========================================================================================
  88.  
  89. code
  90.  
  91. startup:
  92.  
  93.     player = GetLocalPlayerThing();
  94.     litVec = VectorSet(0.7, 0.8, 0.8);
  95.     SetThingFlags(enemy0, 0x80000);
  96.     SetThingFlags(enemy1, 0x80000);
  97.     
  98. return;
  99.  
  100. # -------------------------------------------------------------------
  101.  
  102. activated:
  103.  
  104.     if ((GetSenderRef() == generator) && 
  105.         (GetSourceRef() == player) && 
  106.         (check == 0) && 
  107.         (GetCurItem(player) == 0))
  108.         {
  109.             check = 1;
  110.             # Disable and hide player
  111.             While(wepnum !=0)
  112.                 {
  113.                     wepnum = GetCurWeapon(player);
  114.                     DeselectWeaponWait(player);
  115.                     DeselectWeapon(player);
  116.                     //printint(wepnum);
  117.                 }
  118.             StartCutscene(1);
  119.             SetActorFlags(player, 0x200000);
  120.             SetThingFlags(player, 0x80000);
  121.             
  122.             # Cut to cutscene camera
  123.             SetCameraFocus(0, powerCam);
  124.             SetCurrentCamera(0);
  125.             SetCameraFOV(90, 0, 0);
  126.             CopyPlayerHolsters(player, indy);
  127.             ClearThingFlags(indy, 0x80000);
  128.         
  129.             # Play the animations - wait for Indy's
  130.             PlayKey(generator, lever_down, 4, 0x12, 0);
  131.             PlayKey(indy, in_pull, 4, 0x12, 0);
  132.             Sleep(0.5);
  133.             PlaySoundThing(leverpull, generator, 1, 3, 10, 0);
  134.             
  135.             # Generate Sparks and start machine sound loop
  136.             PlaySoundLocal(zapsound, 1, 0, 0x0, 0);
  137.             CreateThing(spark0, sparkpos0);
  138.             sleep(0.25);
  139.             CreateThing(spark0, sparkpos0);
  140.             PlaySoundLocal(zapSound, 1, 0, 0x0, 0);
  141.             CreateThing(spark0, sparkpos0);
  142.             sleep(0.25);
  143.             CreateThing(spark0, sparkpos0);
  144.             PlayKey(generator, engine_rotate, 4, 0x00, 0);
  145.             MaterialAnim(animat, 12, 1);
  146.             PlaySoundThing(powerHum, generator, 0.75, 1, 5, 1);
  147.             
  148.             SetThingModel(lamp0, litlamp);
  149.             SetThingModel(lamp1, litlamp);
  150.             SetThingModel(lamp2, litlamp);
  151.             SetThingModel(lamp3, litlamp);
  152.             SetThingModel(lamp4, litlamp);
  153.             SetThingModel(lamp5, litlamp);
  154.             SetThingModel(lamp6, litlamp);
  155.             SetThingModel(lamp7, litlamp);
  156.             
  157.             For (count=0; count<=7; count=count+1)
  158.             {
  159.                 SetThingLight(lamp0[count], litVec, 0.6, 1);
  160.             }
  161.             
  162.             Sleep(2.0);
  163.         
  164.             # Watch the gate open...
  165.             SetCameraLookInterp(2, 0);
  166.             SetCameraFocus(2, badguyCam);
  167.             SetCameraSecondaryFocus(2, fencedoor);
  168.             SetCurrentCamera(2);
  169.             SetCameraFOV(90, 0, 0);
  170.             SetCollideType(fenceDoor, 0);
  171.             MoveToFrame(fenceDoor, 1, 1);
  172.             gatechannel = PlaySoundThing(gatesqueal, fencedoor, 1, 10, 20, 1);
  173.             Sleep(0.01);
  174.             SetCameraFOV(60, 1, 3.0);
  175.             WaitForStop(fencedoor);
  176.             SetCollideType(fencedoor, 3);
  177.             StopSound(gatechannel, 0);
  178.             PlaySoundThing(gatestop, fencedoor, 1, 10, 20, 0);
  179.             Sleep(0.5);
  180.             # Warn Volodnikov that Indy's on the loose in his dig site...
  181.             SendMessage(alarmcog, user4);
  182.             Sleep(11);
  183.             SetCollideType(fencedoor1, 0);
  184.             SetCollideType(fencedoor2, 0);
  185.             gatechannel1 = PlaySoundThing(gatesqueal, fencedoor1, 1, 10, 20, 1);
  186.             MoveToFrame(fenceDoor1, 1, 1);
  187.             MoveToFrame(fenceDoor2, 1, 1);
  188.         }
  189.     
  190.     if ((GetCurItem(player) != 0) && (GetSenderID() == 1))
  191.         {
  192.             StopThing(player);
  193.             StartCutscene(1);
  194.             SetActorFlags(player, 0x200000);
  195.             currand = RandBetween(0, 5);
  196.             While (lastrand == currand)
  197.             {
  198.                 currand = RandBetween(0, 5);
  199.             }
  200.             PlayVoice(player, indylineb0[currand], 1, 1);
  201.             lastrand = currand;
  202.             EndCutscene();
  203.             ClearActorFlags(player, 0x200000);
  204.         }
  205.  
  206. return;
  207.  
  208. # ..............................................................................
  209. user4:
  210.  
  211.     # This message comes from the alarmcog
  212.     # after Volodnikov orders his men to catch Indy...
  213.    
  214.      # Watch the enemy march in...
  215.     ClearThingFlags(enemy0, 0x80000);
  216.     ClearThingFlags(enemy1, 0x80000);
  217.     AISetMoveSpeed(enemy0, 1.0);
  218.     AISetMoveSpeed(enemy1, 1.0);
  219.     AISetLookFrame(enemy0, 1);
  220.     AISetMoveFrame(enemy0, 1);
  221.     AISetLookFrame(enemy1, 1);
  222.     AISetMoveFrame(enemy1, 1);
  223.  
  224.     # Play warning music...
  225.     PlaySoundLocal(dangerwav, 1, 0, 0, 0);
  226.  
  227.     # Cut to shot near gate that just opened...
  228.     SetCameraLookInterp(2, 0);
  229.     SetCameraFocus(2, badguyCam);
  230.     SetCameraSecondaryFocus(2, badguytarget);
  231.     SetCameraFOV(60, 0, 0.0);    
  232.     
  233.     Sleep(0.01);
  234.     SetCameraFOV(45, 1, 3.0);
  235.  
  236.     Sleep(1);
  237.     AISetMoveSpeed(enemy1, 1.0);
  238.    
  239.     AISetLookFrame(enemy1, 2);
  240.     AISetMoveFrame(enemy1, 2);
  241.     
  242.     AISetLookFrame(enemy0, 2);
  243.     AISetMoveFrame(enemy0, 2);
  244.     
  245.     AIWaitForStop(enemy1);
  246.     AIWaitForStop(enemy0);
  247.     
  248.     AISetLookThing(enemy0, tgt0);
  249.     AISetLookThing(enemy1, tgt1);
  250.     Sleep(1.0);
  251.     
  252.     WaitForStop(fencedoor1);
  253.     StopSound(gatechannel1, 0);
  254.     PlaySoundThing(gatestop, fencedoor1, 1, 10, 20, 0);
  255.  
  256.     # Return control and camera to player...
  257.     TeleportThing(player, indy);
  258.     SetThingFlags(indy, 0x80000);
  259.     ClearThingFlags(player, 0x80000);
  260.     Sleep(0.1);
  261.     SetCameraFocus(0, player);
  262.     SetCurrentCamera(1);
  263.     ResetCameraFOV(0, 0.0);
  264.     EndCutscene();
  265.     ClearActorFlags(player, 0x200000);
  266.     SetCollideType(fencedoor1, 3);
  267.     SetCollideType(fencedoor2, 3);
  268.     SendMessage(BAB_Commie_Grid, user1);    //Added by JM
  269.  
  270. return;
  271.  
  272. # ..............................................................................
  273.     
  274. end
  275.  
  276.